package biz

import (
	"context"

	"github.com/go-kratos/kratos/v2/log"
)

type CategoryRepo interface {
	ListWithTree(context.Context) ([]*PmsCategory, error)
}

type CategoryUsecase struct {
	repo CategoryRepo
	log  *log.Helper
}

func NewCategoryUsecase(repo CategoryRepo, logger log.Logger) *CategoryUsecase {
	return &CategoryUsecase{repo: repo, log: log.NewHelper(logger)}
}

func (s *CategoryUsecase) ListWithTree(ctx context.Context) ([]*PmsCategory, error) {
	return s.repo.ListWithTree(ctx)
}
